package com.gxuwz.zlc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gxuwz.zlc.entity.JobContent;
import com.gxuwz.zlc.mapper.JobContentMapper;
import com.gxuwz.zlc.service.JobContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobContentServiceImpl implements JobContentService {

    @Autowired
    private JobContentMapper jobContentMapper;

    @Override
    public List<JobContent> findJobContent() {
        return jobContentMapper.selectList(null);
    }

    @Override
    public JobContent findJobJobContentById(String jobContentId) {
        return jobContentMapper.selectById(jobContentId);
    }

    @Override
    public void addJobContent(JobContent jobContent) {
        jobContentMapper.insert(jobContent);
    }

    @Override
    public void updateJobContent(JobContent jobContent) {
        jobContentMapper.updateById(jobContent);
    }

    @Override
    public void deleteJobContent(String jobContentId) {
        jobContentMapper.deleteById(jobContentId);
    }

    @Override
    public List<JobContent> findJobJobContentByAssistantId(String assistantId) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("assistant_id",assistantId);
        return jobContentMapper.selectList(wrapper);
    }
}
